package demo.service;

import demo.info.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

@Service
public class UserService {

//    @Primary  //指定默认
    @Bean
    public UserInfo userInfo1(){
        UserInfo userInfo = new UserInfo();
        userInfo.setName("ming");
        userInfo.setAge(20);
        return userInfo;
    }

    @Bean
    public UserInfo userInfo2(){
        UserInfo userInfo = new UserInfo();
        userInfo.setName("yi");
        userInfo.setAge(20);
        return userInfo;
    }
}
